﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TarreOA.TarreOABLL;
using TarreOA.TarreOAModels;

public partial class Flow_Info_WorkProcessShow : System.Web.UI.Page {
    private int work_id;
    public List<Flow_WorkProcess> list;
    public List<Flow_WorkProcess> left_list = new List<Flow_WorkProcess>();

    protected void Page_Load(object sender, EventArgs e) {
        if(!Page.IsPostBack) {
            if(Request.QueryString.Get("WR_ID") != null) {
                work_id = int.Parse(Request.QueryString.Get("WR_ID"));
                Flow_WorkProcess_Service fwp_service = new Flow_WorkProcess_Service();
                list = fwp_service.FindCurrentOpState(work_id);
                int i = 0;
                foreach(Flow_WorkProcess fwf in list) {
                    if(i > 0) {
                        if(fwf.Step_id != list[i - 1].Step_id) {
                            left_list.Add(fwf);
                        }
                    } else {
                        left_list.Add(fwf);
                    }
                    i++;
                }
                ViewState["work_id"] = work_id;
            }
        }
    }
}
